<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base_user.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>店铺</title>
    <style>
        .fileInput{
            width:100%;
            height:100%;
            position:absolute;
            opacity: 0;
            filter:alpha(opacity=0);
            cursor:pointer;
        }
        #wall{
            top: 0%;
            left:5%;
            transform: scale(0.8);
            position: absolute;
            width:100%;
            height:100%;
        }
    </style>

    <script>
        $(document).ready(function () {
            //上传logo
            $('#File').change(function () {
                $('#form').ajaxSubmit({
                    url:"{:url('mobile/shop_auth/upload_logo')}",
                    type:'post',
                    dataType:'json',
                    enctype: 'multipart/form-data',
                    success:function(t){
                        if (t.code == 200){
                            layer.open({content:'logo上传成功',skin:'msg',time:2});
                            $('.pic3').prop('src',t.message);
                        }else{
                            layer.open({content:t.message,skin:'msg',time:2});
                        }
                    }
                });
            })
        })
        //收藏和取消店铺
        function collect_shop(shop_id){
            if (!'{$Think.session.member_id}'){jump_login();return false;}
            $.ajax({
                url:"member_collect",
                dataType:'json',
                type:'post',
                data:{'type':2,'id':shop_id},
                success:function(t){
                    if (t.code == 200){  //已收藏
                        $('#NUM').text(parseInt($('#NUM').text())+1);
                        $('#collect').prop('src','__STATIC__/img_user/shop_sc_1.png');
                    }else if(t.code == 100){  //取消收藏
                        $('#NUM').text(parseInt($('#NUM').text())-1);
                        $('#collect').prop('src','__STATIC__/img_user/shop_sc_0.png');
                    }
                    layer.open({content:t.message,skin:'msg',time:2});
                }
            })
        }
    </script>
</head>
<body>

<div class="wrap-cre">
    <form action=""  method="get" onsubmit="return false" >
    <div class="header1">
        <img src="__STATIC__/img/back.png" class="back" onclick="back_url()" >
        <div>
            <input onkeydown="search13()" type="search" id="search" name="search" placeholder="请输入搜索关键字" value="{:input('search','')}" maxlength="15">
            <img src="__STATIC__/img_user/fl-sousuotubiao.png" onclick="search_title()">
            <input type="hidden" name="shop_id" id="shop_id" value="{:input('shop_id')}" />
        </div>
    </div>
    </form>
    <div class="center">
        <div class="info">
            <img src="/{$shopInfo.m_banner}" class="pic1" id="wall_0" onerror=this.src='/static/mobile/img_user/web_logo.png' >
            <div class="pic2">
                <img src="/{$shopInfo.logo}"  class="pic3" id="wall_1" onerror = "this.src='/static/mobile/img/empty_img.png'"  >
            </div>
        </div>
        <div class="name">
            <p><span style="color: white;background: #E73F09;border-radius: 4px;font-size: 12px;line-height: 18px;padding: 0 5px;">{eq name="shopInfo.type" value="个人"}自营{/eq}</span> {$shopInfo.title} </p>
            <p>{$shopInfo.description}</p>
        </div>
        <div class="shoucang">
            <a href="javascript:collect_shop({:input('shop_id')});"><img id="collect" src="__STATIC__/img_user/shop_sc_{$collect_status}.png"></a><br>
            <span><font id="NUM">{$shopInfo.collect_number}</font>人收藏</span>
        </div>
    </div>
    <script>
        //返回到来时的url
        function back_url(){
            var url = sessionStorage.getItem('shop_back_url');
            if (!url){
                window.location.href = sessionStorage.getItem('goods_url_back');
            }else{
                sessionStorage.removeItem('come_order_yes');
                window.location.href = url;
            }
        }
    </script>
